﻿/**************************************************************************
创建时间:	2020/6/29
作	  者:	张存
邮 	  箱:	zhangcunliang@126.com

Copyright (c) zhcun.cn

描	述：
记	录：
***************************************************************************/
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Text;
using ZhCun.WebUtils.Authorizes;

namespace ZhCun.WebUtils
{
    public static class ControllerEx
    {
        public static LoginUser GetCurrUser(this ControllerBase controller)
        {
            string token = controller.HttpContext.GetToken();
            var user = LoginState.Get(token);
            return user;
        }
    }
}
